CMAKE_MINIMUM_REQUIRED(VERSION 3.10)


project(SDLshooter VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 11)


if(MSVC)
    add_compile_options(/W4)
else()
    add_compile_options(-Wall -Wextra )
endif()

include_directories(${CMAKE_SOURCE_DIR}/include)


set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR})


set(TARGET ${PROJECT_NAME}-${CMAKE_SYSTEM_NAME})

file(GLOB SOURCES "src/*.cpp")

find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)

add_executable(${TARGET} ${SOURCES})

target_compile_definitions(${TARGET} PRIVATE ASSETS_DIR="${CMAKE_SOURCE_DIR}/assets")
target_link_libraries(${TARGET} 
                        ${SDL2_LIBRARIES}
                        SDL2_image::SDL2_image
                        SDL2_mixer::SDL2_mixer
                        SDL2_ttf::SDL2_ttf 
                        )
